package com.qfjy.zhudongdong;

/**
 * @author : Z-Star
 * @version : 1.0
 * @date : 2022/9/13 18:56
 */
public class ObserverPatternDemo {
    public static void main(String[] args) {
        Subject subject = new Subject();

        //创建三个观察者
        new HexaObserver(subject);
        new OctalObserver(subject);
        new BinaryObserver(subject);

        System.out.println("十进制: 15");
        subject.setState(15);
        System.out.println("十进制: 10");
        subject.setState(10);
    }
}
